package caiwei.android.activity.base;

import caiwei.android.R;
import android.app.Activity;
import android.content.Intent;
import android.widget.Toast;

/**
 * Activity基类，用于封装与业务无关的方法，复用
 * 
 * @author caiwei
 * @date2012-3-1
 * @version 1.0
 */
public class ActivityBase extends Activity
{
	/**
	 * 实现Activity间跳转的方法
	 * 
	 * @param pClass
	 *            Activity的字节码对象
	 */
	protected void openActivity(Class<?> pClass)
	{
		Intent _Intent = new Intent();
		_Intent.setClass(this, pClass);
		startActivity(_Intent);
	}

	/**
	 * 用Toast显示的方法
	 * 
	 * @param pMsg
	 *            显示信息字符串
	 */
	protected void showMsg(String pMsg)
	{
		Toast.makeText(this, pMsg, 1).show();
	}
	
	protected void openActivityAnim(Class<?> pClass)
	{
		Intent _Intent = new Intent();
		_Intent.setClass(this, pClass);
		startActivity(_Intent);
		overridePendingTransition(R.anim.hyperspace_in, R.anim.hyperspace_out);
	}
}
